package cn.iocoder.yudao.module.biz.dal.mysql.safeMetting;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.dal.dataobject.safeMetting.BizSafeMettingDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.safeMetting.vo.*;

/**
 * 安全会议 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface BizSafeMettingMapper extends BaseMapperX<BizSafeMettingDO> {

    default PageResult<BizSafeMettingDO> selectPage(BizSafeMettingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BizSafeMettingDO>()
                .likeIfPresent(BizSafeMettingDO::getName, reqVO.getName())
                .eqIfPresent(BizSafeMettingDO::getContent, reqVO.getContent())
                .betweenIfPresent(BizSafeMettingDO::getTime, reqVO.getBeginTime(), reqVO.getEndTime())
                .eqIfPresent(BizSafeMettingDO::getAddress, reqVO.getAddress())
                .eqIfPresent(BizSafeMettingDO::getLevel, reqVO.getLevel())
                .eqIfPresent(BizSafeMettingDO::getRemark, reqVO.getRemark())
                .eqIfPresent(BizSafeMettingDO::getSceneImage, reqVO.getSceneImage())
                .eqIfPresent(BizSafeMettingDO::getSignImage, reqVO.getSignImage())
                .eqIfPresent(BizSafeMettingDO::getAppendix, reqVO.getAppendix())
                .betweenIfPresent(BizSafeMettingDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .eqIfPresent(BizSafeMettingDO::getDeptId, reqVO.getDeptId())
                .orderByDesc(BizSafeMettingDO::getId));
    }

    default List<BizSafeMettingDO> selectList(BizSafeMettingExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BizSafeMettingDO>()
                .likeIfPresent(BizSafeMettingDO::getName, reqVO.getName())
                .eqIfPresent(BizSafeMettingDO::getContent, reqVO.getContent())
                .betweenIfPresent(BizSafeMettingDO::getTime, reqVO.getBeginTime(), reqVO.getEndTime())
                .eqIfPresent(BizSafeMettingDO::getAddress, reqVO.getAddress())
                .eqIfPresent(BizSafeMettingDO::getLevel, reqVO.getLevel())
                .eqIfPresent(BizSafeMettingDO::getRemark, reqVO.getRemark())
                .eqIfPresent(BizSafeMettingDO::getSceneImage, reqVO.getSceneImage())
                .eqIfPresent(BizSafeMettingDO::getSignImage, reqVO.getSignImage())
                .eqIfPresent(BizSafeMettingDO::getAppendix, reqVO.getAppendix())
                .betweenIfPresent(BizSafeMettingDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .eqIfPresent(BizSafeMettingDO::getDeptId, reqVO.getDeptId())
                .orderByDesc(BizSafeMettingDO::getId));
    }

}
